<?php
require_once 'database.php';
require_once '../DTO/DOANHNGHIEP_DTO.php';
class xl_loai_phieu extends database
{
    function danh_sach($vi_tri, $so_luong)
    {
        $vi_tri = intval($vi_tri);
        $so_luong = intval($so_luong);
        $sql = "select * from doanh_nghiep limit $vi_tri, $so_luong";
        $this->setQuery($sql);
        return $this->loadAllRow();
    }

    function lay_ma($string)
    {
        $string = stripslashes($string);
        $string = addslashes($string);

        $sql = "select ma from loai_phieu where ten_loai='$string'";
        $this->setQuery($sql);
        $row =  $this->loadRow();
        return $row['ma'];

    }


}
